/**
 * 存储配置
 */

const { isProd } = require('../utils/env')

const { MYSQLNAME, MYSQLPATH, PATH, MYSQLPSD } =  require('./constant');

//微信小程序的配置信息
let WX_CONFIG = {
    wxchatAppId: 'wx60b199f15ca91c29',
    wxchatSecret: 'ad22767359a5a8c18496bf7941b68c8d'
}

//aliyun短信平台的配置信息
let AliCloudConf = {
    accessKeyId: 'LTAI4FmtqPb2ZWYktuMjQ9Cj',
    accessSecret: 'LCxrFyxCw6EFlnXU9ABggPzXfI1uxR',
    name:'角瑟',//签名
    sms_code:'SMS_175070076'//模版名字
}

//数据库的配置信息
let MYSQL_CONF = {
    host: MYSQLPATH,
    user: 'root',
    password: MYSQLPSD,
    timezone: '+08:00',
    dialectOptions: {
        dateStrings: true,
        typeCast: true
    },
    port: '3306',
    database: MYSQLNAME
}

if (isProd) { //生产环境
    MYSQL_CONF = {
        // 线上的 mysql 配置
        host: MYSQLPATH,
        user: 'root',
        timezone: '+08:00',
        dialectOptions:{
            dateStrings:true,
            typeCast:true
        },
        password: MYSQLPSD,
        port: '3306',
        database: MYSQLNAME
    }

}

module.exports = {
    AliCloudConf,
    WX_CONFIG,
    MYSQL_CONF
}
